package comunicationFrames;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;

@SuppressWarnings("serial")
public class Message implements Serializable {
	private String timestamp;
	private long from;
	private long to;
	private String message;
	
	public Message(long from, long to, String message) {
		super();
		this.from = from;
		this.to = to;
		this.message = message;
		
		Calendar cal = Calendar.getInstance();
	    SimpleDateFormat sdf = new SimpleDateFormat("h:mm");
		this.timestamp = sdf.format(cal.getTime());
	}
	
	public String getTimestamp() {
		return timestamp;
	}
	public long getFrom() {
		return from;
	}
	public long getTo() {
		return to;
	}
	public String getMessage() {
		return message;
	}
}
